home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 8 / Eagles_Nest_Mac_Collection_Disc_8.TOAST / Developer Tools⁄Additions / MacsbugBook / MacsBug Book Disk / Debugger Prefs sources / Heap.c < prev    next >
MacBinary  |  1990-07-24  |  2.5 KB  |  [TEXT/MPS ]

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: Heap.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Jul 24 13:00:00 1990, modified Tue Jul 24 13:00:00 1990, creator 'MPS ', type ASCII, 1853 bytes "Heap.c" , at 0x7bd 479 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 48 65 61 70 2e 63 | 00 00 00 00 00 00 00 00 |..Heap.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 07 3d 00 | 00 01 df a2 d2 2f 10 a2 |......=.|...../..|
|00000060| d2 2f 10 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |./......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 e1 cf 00 00 |........|........|
|00000080| 2f 2a 20 48 65 61 70 2e | 63 0d 0d 20 20 20 54 68 |/* Heap.|c.. Th|
|00000090| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 4d 50 57 20 |e follow|ing MPW |
|000000a0| 63 6f 6d 6d 61 6e 64 73 | 20 77 69 6c 6c 20 62 75 |commands| will bu|
|000000b0| 69 6c 64 20 74 68 65 20 | 64 63 6d 64 20 61 6e 64 |ild the |dcmd and|
|000000c0| 20 63 6f 70 79 20 69 74 | 20 74 6f 20 74 68 65 0d | copy it| to the.|
|000000d0| 20 20 20 22 44 65 62 75 | 67 67 65 72 20 50 72 65 | "Debu|gger Pre|
|000000e0| 66 73 22 20 66 69 6c 65 | 20 69 6e 20 74 68 65 20 |fs" file| in the |
|000000f0| 53 79 73 74 65 6d 20 66 | 6f 6c 64 65 72 2e 20 54 |System f|older. T|
|00000100| 68 65 20 64 63 6d 64 27 | 73 20 6e 61 6d 65 20 69 |he dcmd'|s name i|
|00000110| 6e 0d 20 20 20 4d 61 63 | 73 42 75 67 20 77 69 6c |n. Mac|sBug wil|
|00000120| 6c 20 62 65 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |l be the| name of|
|00000130| 20 74 68 65 20 66 69 6c | 65 20 62 75 69 6c 74 20 | the fil|e built |
|00000140| 62 79 20 74 68 65 20 4c | 69 6e 6b 65 72 2e 0d 0d |by the L|inker...|
|00000150| 09 20 20 20 20 43 20 48 | 65 61 70 2e 63 20 2d 62 |. C H|eap.c -b|
|00000160| 0d 09 09 4c 69 6e 6b 20 | 7b 64 63 6d 64 4c 69 62 |...Link |{dcmdLib|
|00000170| 7d 64 63 6d 64 47 6c 75 | 65 2e 61 2e 6f 20 48 65 |}dcmdGlu|e.a.o He|
|00000180| 61 70 2e 63 2e 6f 20 7b | 64 63 6d 64 4c 69 62 7d |ap.c.o {|dcmdLib}|
|00000190| 44 52 75 6e 74 69 6d 65 | 2e 6f 20 7b 43 4c 69 62 |DRuntime|.o {CLib|
|000001a0| 72 61 72 69 65 73 7d 53 | 74 64 43 4c 69 62 2e 6f |raries}S|tdCLib.o|
|000001b0| 20 2d 6f 20 48 65 61 70 | 0d 09 09 42 75 69 6c 64 | -o Heap|...Build|
|000001c0| 44 63 6d 64 20 48 65 61 | 70 20 31 30 30 0d 09 09 |Dcmd Hea|p 100...|
|000001d0| 45 63 68 6f 20 27 69 6e | 63 6c 75 64 65 20 22 48 |Echo 'in|clude "H|
|000001e0| 65 61 70 22 3b 27 09 7c | 09 52 65 7a 20 2d 61 20 |eap";'.||.Rez -a |
|000001f0| 2d 6f 20 22 7b 73 79 73 | 74 65 6d 46 6f 6c 64 65 |-o "{sys|temFolde|
|00000200| 72 7d 44 65 62 75 67 67 | 65 72 20 50 72 65 66 73 |r}Debugg|er Prefs|
|00000210| 22 0d 20 2a 2f 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |". */..#|include |
|00000220| 3c 54 79 70 65 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |<Types.h|>.#inclu|
|00000230| 64 65 20 22 64 63 6d 64 | 2e 68 22 0d 0d 0d 76 6f |de "dcmd|.h"...vo|
|00000240| 69 64 20 4e 75 6d 62 65 | 72 54 6f 48 65 78 20 28 |id Numbe|rToHex (|
|00000250| 6c 6f 6e 67 20 6e 75 6d | 62 65 72 2c 20 53 74 72 |long num|ber, Str|
|00000260| 32 35 35 20 68 65 78 29 | 0d 7b 0d 09 53 74 72 32 |255 hex)|.{..Str2|
|00000270| 35 35 09 64 69 67 69 74 | 73 20 3d 20 22 30 31 32 |55.digit|s = "012|
|00000280| 33 34 35 36 37 38 39 41 | 42 43 44 45 46 22 3b 0d |3456789A|BCDEF";.|
|00000290| 09 69 6e 74 09 09 6e 3b | 0d 0d 09 73 74 72 63 70 |.int..n;|...strcp|
|000002a0| 79 20 28 68 65 78 2c 20 | 26 22 2e 30 30 30 30 30 |y (hex, |&".00000|
|000002b0| 30 30 30 22 29 3b 0d 09 | 68 65 78 5b 30 5d 20 3d |000");..|hex[0] =|
|000002c0| 20 38 3b 0d 09 66 6f 72 | 20 28 6e 20 3d 20 38 3b | 8;..for| (n = 8;|
|000002d0| 20 6e 20 3e 3d 20 31 3b | 20 6e 2d 2d 29 0d 09 09 | n >= 1;| n--)...|
|000002e0| 7b 0d 09 09 68 65 78 5b | 6e 5d 20 3d 20 64 69 67 |{...hex[|n] = dig|
|000002f0| 69 74 73 5b 6e 75 6d 62 | 65 72 20 25 20 31 36 5d |its[numb|er % 16]|
|00000300| 3b 0d 09 09 6e 75 6d 62 | 65 72 20 3d 20 6e 75 6d |;...numb|er = num|
|00000310| 62 65 72 20 2f 20 31 36 | 3b 0d 09 09 7d 0d 7d 20 |ber / 16|;...}.} |
|00000320| 2f 2f 20 4e 75 6d 62 65 | 72 54 6f 48 65 78 0d 0d |// Numbe|rToHex..|
|00000330| 0d 70 61 73 63 61 6c 20 | 76 6f 69 64 20 44 69 73 |.pascal |void Dis|
|00000340| 70 6c 61 79 42 6c 6f 63 | 6b 49 6e 66 6f 20 28 6c |playBloc|kInfo (l|
|00000350| 6f 6e 67 20 62 6c 6f 63 | 6b 41 64 64 72 65 73 73 |ong bloc|kAddress|
|00000360| 2c 20 6c 6f 6e 67 20 62 | 6c 6f 63 6b 4c 65 6e 67 |, long b|lockLeng|
|00000370| 74 68 2c 20 6c 6f 6e 67 | 20 6d 61 73 74 65 72 50 |th, long| masterP|
|00000380| 74 72 2c 20 73 68 6f 72 | 74 20 62 6c 6f 63 6b 54 |tr, shor|t blockT|
|00000390| 79 70 65 2c 20 42 6f 6f | 6c 65 61 6e 20 6c 6f 63 |ype, Boo|lean loc|
|000003a0| 6b 65 64 2c 20 42 6f 6f | 6c 65 61 6e 20 70 75 72 |ked, Boo|lean pur|
|000003b0| 67 65 61 62 6c 65 2c 20 | 42 6f 6f 6c 65 61 6e 20 |geable, |Boolean |
|000003c0| 72 65 73 6f 75 72 63 65 | 29 0d 7b 0d 09 53 74 72 |resource|).{..Str|
|000003d0| 32 35 35 20 76 61 6c 75 | 65 3b 0d 0d 09 4e 75 6d |255 valu|e;...Num|
|000003e0| 62 65 72 54 6f 48 65 78 | 20 28 62 6c 6f 63 6b 41 |berToHex| (blockA|
|000003f0| 64 64 72 65 73 73 2c 20 | 76 61 6c 75 65 29 3b 0d |ddress, |value);.|
|00000400| 09 64 63 6d 64 44 72 61 | 77 4c 69 6e 65 20 28 76 |.dcmdDra|wLine (v|
|00000410| 61 6c 75 65 29 3b 0d 0d | 09 4e 75 6d 62 65 72 54 |alue);..|.NumberT|
|00000420| 6f 48 65 78 20 28 62 6c | 6f 63 6b 4c 65 6e 67 74 |oHex (bl|ockLengt|
|00000430| 68 2c 20 76 61 6c 75 65 | 29 3b 0d 09 64 63 6d 64 |h, value|);..dcmd|
|00000440| 44 72 61 77 53 74 72 69 | 6e 67 20 28 22 5c 70 20 |DrawStri|ng ("\p |
|00000450| 22 29 3b 0d 09 64 63 6d | 64 44 72 61 77 53 74 72 |");..dcm|dDrawStr|
|00000460| 69 6e 67 20 28 76 61 6c | 75 65 29 3b 0d 0d 09 69 |ing (val|ue);...i|
|00000470| 66 20 28 62 6c 6f 63 6b | 54 79 70 65 20 3d 3d 20 |f (block|Type == |
|00000480| 72 65 6c 6f 63 61 74 61 | 62 6c 65 42 6c 6f 63 6b |relocata|bleBlock|
|00000490| 29 0d 09 09 7b 0d 09 09 | 4e 75 6d 62 65 72 54 6f |)...{...|NumberTo|
|000004a0| 48 65 78 20 28 6d 61 73 | 74 65 72 50 74 72 2c 20 |Hex (mas|terPtr, |
|000004b0| 76 61 6c 75 65 29 3b 0d | 09 09 64 63 6d 64 44 72 |value);.|..dcmdDr|
|000004c0| 61 77 53 74 72 69 6e 67 | 20 28 22 5c 70 20 22 29 |awString| ("\p ")|
|000004d0| 3b 0d 09 09 64 63 6d 64 | 44 72 61 77 53 74 72 69 |;...dcmd|DrawStri|
|000004e0| 6e 67 20 28 76 61 6c 75 | 65 29 3b 0d 0d 09 09 64 |ng (valu|e);....d|
|000004f0| 63 6d 64 44 72 61 77 53 | 74 72 69 6e 67 20 28 22 |cmdDrawS|tring ("|
|00000500| 5c 70 20 22 29 3b 0d 09 | 09 69 66 20 28 6c 6f 63 |\p ");..|.if (loc|
|00000510| 6b 65 64 29 0d 09 09 09 | 7b 20 64 63 6d 64 44 72 |ked)....|{ dcmdDr|
|00000520| 61 77 53 74 72 69 6e 67 | 20 28 22 5c 70 4c 6f 63 |awString| ("\pLoc|
|00000530| 6b 65 64 20 22 29 3b 20 | 7d 0d 09 09 69 66 20 28 |ked "); |}...if (|
|00000540| 70 75 72 67 65 61 62 6c | 65 29 0d 09 09 09 7b 20 |purgeabl|e)....{ |
|00000550| 64 63 6d 64 44 72 61 77 | 53 74 72 69 6e 67 20 28 |dcmdDraw|String (|
|00000560| 22 5c 70 50 75 72 67 65 | 61 62 6c 65 20 22 29 3b |"\pPurge|able ");|
|00000570| 20 7d 0d 09 09 69 66 20 | 28 72 65 73 6f 75 72 63 | }...if |(resourc|
|00000580| 65 29 0d 09 09 09 7b 20 | 64 63 6d 64 44 72 61 77 |e)....{ |dcmdDraw|
|00000590| 53 74 72 69 6e 67 20 28 | 22 5c 70 52 65 73 6f 75 |String (|"\pResou|
|000005a0| 72 63 65 20 22 29 3b 20 | 7d 0d 09 09 7d 0d 7d 20 |rce "); |}...}.} |
|000005b0| 2f 2f 20 44 69 73 70 6c | 61 79 42 6c 6f 63 6b 49 |// Displ|ayBlockI|
|000005c0| 6e 66 6f 0d 0d 0d 70 61 | 73 63 61 6c 20 76 6f 69 |nfo...pa|scal voi|
|000005d0| 64 20 43 6f 6d 6d 61 6e | 64 45 6e 74 72 79 20 28 |d Comman|dEntry (|
|000005e0| 64 63 6d 64 42 6c 6f 63 | 6b 2a 20 70 61 72 61 6d |dcmdBloc|k* param|
|000005f0| 50 74 72 29 0d 7b 0d 09 | 73 77 69 74 63 68 20 28 |Ptr).{..|switch (|
|00000600| 70 61 72 61 6d 50 74 72 | 2d 3e 72 65 71 75 65 73 |paramPtr|->reques|
|00000610| 74 29 0d 09 09 7b 0d 09 | 09 63 61 73 65 20 64 63 |t)...{..|.case dc|
|00000620| 6d 64 49 6e 69 74 3a 0d | 09 09 09 62 72 65 61 6b |mdInit:.|...break|
|00000630| 3b 0d 0d 09 09 63 61 73 | 65 20 64 63 6d 64 48 65 |;....cas|e dcmdHe|
|00000640| 6c 70 3a 0d 09 09 09 64 | 63 6d 64 44 72 61 77 4c |lp:....d|cmdDrawL|
|00000650| 69 6e 65 20 28 22 5c 70 | 48 45 41 50 22 29 3b 0d |ine ("\p|HEAP");.|
|00000660| 09 09 09 64 63 6d 64 44 | 72 61 77 4c 69 6e 65 20 |...dcmdD|rawLine |
|00000670| 28 22 5c 70 20 20 20 44 | 69 73 70 6c 61 79 73 20 |("\p D|isplays |
|00000680| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 61 62 6f 75 |informat|ion abou|
|00000690| 74 20 61 6c 6c 20 68 65 | 61 70 20 62 6c 6f 63 6b |t all he|ap block|
|000006a0| 73 22 29 3b 0d 09 09 09 | 62 72 65 61 6b 3b 0d 0d |s");....|break;..|
|000006b0| 09 09 63 61 73 65 20 64 | 63 6d 64 44 6f 49 74 3a |..case d|cmdDoIt:|
|000006c0| 0d 09 09 09 2f 2f 20 44 | 72 61 77 20 74 68 65 20 |....// D|raw the |
|000006d0| 63 6f 6c 75 6d 6e 20 6c | 61 62 65 6c 73 0d 09 09 |column l|abels...|
|000006e0| 09 64 63 6d 64 44 72 61 | 77 4c 69 6e 65 20 28 22 |.dcmdDra|wLine ("|
|000006f0| 5c 70 20 20 41 64 64 72 | 65 73 73 20 20 20 4c 65 |\p Addr|ess Le|
|00000700| 6e 67 74 68 20 20 4d 73 | 74 72 20 50 74 72 22 29 |ngth Ms|tr Ptr")|
|00000710| 3b 0d 0d 20 20 20 20 09 | 09 2f 2f 20 54 68 65 20 |;.. .|.// The |
|00000720| 4d 61 63 73 42 75 67 20 | 68 65 61 70 20 69 74 65 |MacsBug |heap ite|
|00000730| 72 61 74 6f 72 20 77 69 | 6c 6c 20 63 61 6c 6c 20 |rator wi|ll call |
|00000740| 44 69 73 70 6c 61 79 42 | 6c 6f 63 6b 49 6e 66 6f |DisplayB|lockInfo|
|00000750| 20 6f 6e 63 65 20 66 6f | 72 20 65 61 63 68 20 62 | once fo|r each b|
|00000760| 6c 6f 63 6b 20 69 6e 20 | 74 68 65 20 68 65 61 70 |lock in |the heap|
|00000770| 0d 09 09 09 64 63 6d 64 | 46 6f 72 41 6c 6c 48 65 |....dcmd|ForAllHe|
|00000780| 61 70 42 6c 6f 63 6b 73 | 20 28 44 69 73 70 6c 61 |apBlocks| (Displa|
|00000790| 79 42 6c 6f 63 6b 49 6e | 66 6f 29 3b 0d 09 09 09 |yBlockIn|fo);....|
|000007a0| 62 72 65 61 6b 3b 0d 09 | 09 7d 0d 7d 20 2f 2f 20 |break;..|.}.} // |
|000007b0| 43 6f 6d 6d 61 6e 64 45 | 6e 74 72 79 0d 00 00 00 |CommandE|ntry....|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 00 00 01 00 00 00 01 8d | 00 00 00 8d 00 00 00 52 |........|.......R|
|00000810| 42 a7 20 6c 00 1c 20 68 | 00 16 2f 10 42 67 1f 2b |B. l.. h|../.Bg.+|
|00000820| 00 18 4e ba d6 c8 2d 5f | ff fc 10 2b 00 18 67 72 |..N...-_|...+..gr|
|00000830| 06 48 65 61 70 2e 63 da | 02 00 00 00 54 45 58 54 |.Heap.c.|....TEXT|
|00000840| 4d 50 53 20 01 00 00 c0 | 00 80 00 00 00 00 03 c5 |MPS ....|........|
|00000850| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 c0 00 80 |..TEXTMP|S ......|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 a2 d1 e8 c0 00 00 | 07 3d 00 00 01 df 67 12 |........|.=....g.|
|00000880| 3f 3c ff ff 4e ba d4 64 | 2f 2c 00 1c 4e ba e4 14 |?<..N..d|/,..N...|
|00000890| 60 0c 20 6e ff fc 3f 28 | 01 04 4e ba d4 4e 60 00 |`. n..?(|..N..N`.|
|000008a0| 02 54 3f 3c ff ff 4e ba | d4 42 42 67 4e ba d3 a2 |.T?<..N.|.BBgN...|
|000008b0| 4a ac 00 18 67 16 42 67 | 2f 2c 00 18 1f 3c 00 01 |J...g.Bg|/,...<..|
|000008c0| 48 7a 02 5e 4e ba d6 a4 | 3c 1f 60 02 42 46 3f 3c |Hz.^N...|<.`.BF?<|
|000008d0| 00 fb 4e ba d3 7c 42 67 | 4e ba d3 76 20 6b 00 14 |..N..|Bg|N..v k..|
|000008e0| 70 03 b0 28 00 13 66 0a | 3f 3c 00 05 4e ba d3 fc |p..(..f.|?<..N...|
|000008f0| 60 5e 20 6b 00 14 70 04 | b0 90 5d c0 20 6b 00 14 |`^ k..p.|..]. k..|
|00000900| 00 00 00 1b 06 02 60 01 | 00 00 06 36 2e 32 62 31 |......`.|...6.2b1|
|00000910| 31 0d 4d 61 63 73 42 75 | 67 20 36 2e 32 62 31 00 |1.MacsBu|g 6.2b1.|
|00000920| 00 00 48 00 09 4d 6f 6e | 61 63 6f 00 00 00 ac 00 |..H..Mon|aco.....|
|00000930| 01 a6 b4 00 0a 00 03 00 | 09 00 0e 00 0a 00 00 00 |........|........|
|00000940| 00 00 98 00 01 00 06 00 | 04 00 31 00 0a 01 49 01 |........|..1...I.|
|00000950| ea 00 31 00 0a 01 49 01 | ea a2 d1 e8 c0 00 00 00 |..1...I.|........|
|00000960| d0 00 00 01 4e 00 00 05 | 97 01 00 00 00 00 1e 00 |....N...|........|
|00000970| 31 00 0a 01 49 01 ea 00 | 31 00 0a 01 49 01 ea 00 |1...I...|1...I...|
|00000980| 00 05 97 00 00 00 00 00 | 00 00 00 00 00 00 00 01 |........|........|
|00000990| 00 00 00 01 8d 00 00 00 | 8d 00 00 00 52 00 11 0f |........|....R...|
|000009a0| d4 0e b2 00 00 00 1c 00 | 52 00 01 76 65 72 73 00 |........|R..vers.|
|000009b0| 00 00 12 4d 50 53 52 00 | 01 00 1e 00 02 ff ff 20 |...MPSR.|....... |
|000009c0| 00 00 00 00 00 00 00 03 | ed ff ff 00 00 00 1f 00 |........|........|
|000009d0| 00 00 00 03 f0 ff ff 00 | 00 00 6b 00 12 ef 94 00 |........|..k.....|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+